#include "stdafx.h"

void Work::pushFreeSession(Session* pSession)
{
	if (!pSession || !m_SessionList)
		return;
	m_SessionList->m_end->m_next = pSession;
	m_SessionList->m_end = pSession;
	m_SessionList->m_end->m_next = NULL;
}

Session* Work::getFreeSession()
{
	if (m_SessionList == NULL)
		return NULL;
	Session* pItem = NULL;
	if (m_SessionList->m_head != m_SessionList->m_end)
	{
		pItem = m_SessionList->m_head;
		m_SessionList->m_head = pItem->m_next;
		pItem->m_next = NULL;
	}
	return pItem;
}